home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks96 / BetterADsecurity.sit / Better AD security / Source / ES Address Table.c < prev    next >
C/C++ Source or Header  |  1996-06-21  |  2KB  |  63 lines

  1. /*    NAME:
  2.         ES Address Table.c
  3.  
  4.     WRITTEN BY:
  5.         Dair Grant
  6.  
  7.     DESCRIPTION:
  8.         This file contains a a code resource that acts as a Gestalt Selector
  9.         function to be installed as an address table. When called, it will
  10.         return the address of its internal address table.
  11.  
  12.     ___________________________________________________________________________
  13. */
  14. //=============================================================================
  15. //        Include files
  16. //-----------------------------------------------------------------------------
  17. #include "A4Stuff.h"
  18. #include "SetupA4.h"
  19. #include "ES Address Table.h"
  20.  
  21.  
  22. //=============================================================================
  23. //        Function prototypes                                                                     
  24. //-----------------------------------------------------------------------------
  25. pascal OSErr main(OSType theSelector, long *theResponse);
  26.  
  27.  
  28. //=============================================================================
  29. //        Global variables                                                                 
  30. //-----------------------------------------------------------------------------
  31. ESAddressTable        gTheAddressTable;
  32.  
  33.  
  34. //=============================================================================
  35. //        main : Entry point to our Gestalt Selector function.                                                                 
  36. //-----------------------------------------------------------------------------
  37. //        Note :    When called, we return the address of our address table
  38. //                structure.
  39. //-----------------------------------------------------------------------------
  40. pascal OSErr main(OSType theSelector, long *theResponse)
  41. {    long            oldA4;
  42.  
  43.  
  44.  
  45.     // Set up A4 to access our globals
  46. #ifndef powerc
  47.     oldA4 = SetCurrentA4();
  48. #endif
  49.  
  50.                 
  51.     // Return the address of gTheAddressTable. We treat theResponse as a pointer
  52.     // to a variable that's a pointer to an address table, and write to it
  53.     // accordingly.
  54.     *theResponse = (long) &gTheAddressTable;
  55.  
  56.  
  57.     // Restore A4 and return
  58. #ifndef powerc
  59.     SetA4(oldA4);
  60. #endif
  61.     return(noErr);
  62. }
  63.